<template>
	<view class="mask" @click="close"></view>
	<view class="privacy-modal">
		<view class="popup-component">
			<view class="title">家长守护助手隐私政策提示</view>
			<view class="content">
				<view class="text">
					欢迎您使用家长守护助手小程序，为了保护您的合法权益，请您务必仔细阅读并充分理解 <view class="link" @click="toPolicyPrivacy">《家长守护助手隐私协议》</view>以及<view class="link" @click="userAgreement">《家长守护助手用户协议》</view>
					相关内容，若您点击“同意”,即表示您已阅读并同意上述条款，家长守护助手小程序将严格按照各项条款使用和保护您的个人信息
				</view>
			</view>
			<view class="foolter">
				<view class="btn base-agree agree-btn"  @click="agree">同意</view>
				<view class="btn base-agree not-agree-btn" @click="close">不同意</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref} from 'vue'
	const props = defineProps({
		from:{
			requred: true,
			type: String
		},
		show: {
			requred: true,
			type: Boolean
		},
		customStyle:{
			requred: true,
			type: Object,
			default: () => {
				return {
					height:"40%",
				}
			}
		}
	})
	

	const emits = defineEmits(["onClose", 'onAgree'])
	const close = () => {
		emits("onClose");
	} 
	const agree = () => {
		emits('onAgree')
	}
	
	const toPolicyPrivacy = () => {
		uni.navigateTo({
			url:`/pagesC/policyPrivacy/index?from=${props.from}`
		})
	}
	const userAgreement = () => {
		uni.navigateTo({
			url: `/pagesC/userAgreement/index?from=${props.from}`
		})
	}
</script>

<style scoped lang="scss">
	.popup-component{
		width: 60vw;
		padding: 40upx;
		margin: 0 auto;
		.title{
			font-size: 30upx;
			line-height: 60upx;
			text-align: center;
			font-weight: bold;
		}
		.content{
			.text{
				font-size: 26upx;
				color: #5d5d5d;
				line-height: 45upx;
				.link{
					color: $blue-theme;
					margin: 0 5px;
					display: inline;
				}
			}
		}
		.foolter{
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			margin-top: 25upx;
			.btn{
				margin: 15upx 0;
				width: 100%;
				text-align: center;
			}
		}
	}
	
</style>
<style lang="scss">
	.foolter{
		button {
			padding:0 50upx;
			width: 100%;
		}
		.base-agree{
			display: flex;
			justify-content: center;
			align-items: center;
			width: 100upx;
			height: 80upx;
			border-radius: 40upx;
			font-size: 32upx;
			text-align: center;
		} 
		.agree-btn{
			background-color: $blue-theme;
			color: #fff;
		}
		.not-agree-btn{
			background-color: #ffff;
			border:1px solid #ccc;
		}
	}
	
	
	.privacy-modal{
		position: absolute;
		z-index: 1000;
		width: 80%;
		height: 60%;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
		margin: auto;
		background-color: #fff;
		border-radius: 30upx;
	}
	
	.mask{
		position: fixed;
		z-index: 10;
		top: 0;
		right: 0;
		bottom:0;
		left: 0;
		background-color: rgba(0, 0, 0, 0.5);
	}
</style>